package com.m3839.sdk.common.env2.platform;

import android.util.Pair;

import com.m3839.sdk.common.env.EnvConfig;
import com.m3839.sdk.common.env2.Env;
import com.m3839.sdk.common.env2.IPlatformApi;

import java.util.HashMap;
import java.util.Map;

/**
 * @author ChenBaoyang
 * @description: AntiPlatformApi
 * @date 2021/11/6 10:20
 */
public class AntiPlatformApi extends IPlatformApi {

    /** 平台ID：用来表示防沉迷-使用平台 */
    protected static final String KET_PTID = "ptid";
    protected static final String VALUE_PTID = "1020";
    protected static final String VALUE_PTID_FCM = "1030";
    protected static final String VALUE_PTIP_TEST = "20";

    /** 防沉迷接口-念靖提供 */
    protected static final String SDK_ANTI_HOST = "https://apps.4399.com/";

    public static Map<Integer, EnvConfig> envConfigMap = new HashMap<>();

    static {
        envConfigMap.put(Env.ENV_TEST, new EnvConfig(SDK_ANTI_HOST, null, new Pair<>(KET_PTID, VALUE_PTIP_TEST)));
        envConfigMap.put(Env.ENV_ONLINE_TEST, new EnvConfig(SDK_ANTI_HOST, null, new Pair<>(KET_PTID, VALUE_PTID)));
        envConfigMap.put(Env.ENV_OFFICIAL, new EnvConfig(SDK_ANTI_HOST, null, new Pair<>(KET_PTID, VALUE_PTID)));
    }

    @Override
    public EnvConfig getApi(int env) {
        return envConfigMap.get(env);
    }
}
